package cn.wolfcode.trip.base.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;

@Getter
@Setter
public class SingIn extends BaseDomain{

    private Date singinday;

    private User user ;


    public String getJsonString() {
        HashMap<Object, Object> map = new HashMap();
        map.put("id", id);
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd ");
        String format = simpleDateFormat.format(singinday);
        String[] arr = format.split("-");
        map.put("signDay",arr[2]);
        map.put("user.id", user.getId());
        return JSON.toJSONString(map);
    }
}